﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZXIMEW.DAL;
using ZXIMEW.Models.DModels;

namespace ZXIMEW.BLL
{
    public class MenuBLL
    {
        MenuDAL menuDAL = new MenuDAL();
        /// <summary>
        /// 获取一级菜单列表
        /// </summary>
        /// <param name="roleIds"></param>
        /// <param name="isAdmin"></param>
        /// <returns></returns>
        public List<MenuInfo> GetFirstMenuList(List<int> roleIds, bool isAdmin)
        {
            return menuDAL.GetMenus(roleIds, 0, isAdmin);
        }

        /// <summary>
        /// 获取指定菜单的子菜单列表
        /// </summary>
        /// <param name="roleIds"></param>
        /// <param name="parentId"></param>
        /// <param name="isAdmin"></param>
        /// <returns></returns>
        public List<MenuInfo> GetMenusByParentId(List<int> roleIds, int parentId, bool isAdmin)
        {
            return menuDAL.GetMenus(roleIds, parentId, isAdmin);
        }
    }
}
